/**
 * Created with IntelliJ IDEA.
 * User: Администратор
 * Date: 01.07.12
 * Time: 3:28
 * To change this template use File | Settings | File Templates.
 */
require(
    [ "dojo/parser", "dijit/form/Button", "dijit/form/TextBox" ]
    );
//dojo.require("dojo.parser");
//dojo.require("dijit.form.Button");
//dojo.require("dijit.form.TextBox");

var init = function() {
    require(
        ["dojo/on"], function(on) {
            on(
                dojo.byId("btnSayHello"),
                "click",
                helloButton_onClick
            );
        }
    );
}

//button onClick listener
var helloButton_onClick = function(event) {
    alert('Hello world and hello ' +
        dojo.byId("txtName").value + '!');
}

//start initializing
//dojo.addOnLoad(init);  //<1.7
require(["dojo/ready"], function(ready){
    ready(init);
});